package com.trade.data.type;


public enum InstrumentTypes{
	OPTIDX(1,"Index Option","OPTIDX"),
	FUTIDX(2,"Index Future","FUTIDX"),
	OPTSTK(3,"Stock Option","OPTSTK"),
	FUTSTK(4,"Stock Future","FUTSTK");

	int id;
	String name;
	String value;

	InstrumentTypes(int id , String name,String value){
		this.id = id;
		this.name = name;
		this.value = value;
	}

	public String getValue(){
		return this.value;
	}

	public static InstrumentTypes getByValue(String value){
		for(InstrumentTypes instrumentType : InstrumentTypes.values()){
			if( instrumentType.getValue().equals( value) ){
				return instrumentType;
			}
		}

		return null;
	}

}